package com.lambda.lambda;

import org.springframework.util.CollectionUtils;

import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * @author zhaoyunlong
 * @date 2020/11/9
 * @description
 */
public class Demo {

    public static void main(String[] args) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("this is running");
        }
        }).start();

        new Thread(()->{
            System.out.println("this is running");
        }).start();


        List<String> list = Arrays.asList("123", "214","254","2345");
        Collections.sort(list, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return o1.length()-o2.length();
            }
        });

        for (String value: list) {
            System.out.println(value);
        }

        Collections.sort(list, (value1, value2)->
             value1.length()-value1.length()
        );
        list.forEach(System.out::println);

        String a = "123";
        System.out.println(a);
    }
}
